home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).zip / Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).adf / ak_gen0-lib_V38.20.LHA / ak_gen0-library / Programmers.LHA / Programmers / Headers / ak_gen0.h < prev   
C/C++ Source or Header  |  1993-10-17  |  18KB  |  465 lines

  1. /* ************************************************************************ */
  2. /* AK_GEN0_H (Headerfile for use with the "ak_gen0.library")                */
  3. /* ************************************************************************ */
  4. /* (c) 1989-93 by Andreas Ralph Kleinert. All rights reserved.              */
  5. /* COMMERCIAL USE IS NOT ALLOWED WITHOUT SPECIAL PERMISSION BY THE AUTHOR ! */
  6. /* ************************************************************************ */
  7. /* Version        : V38.20                            */
  8. /* Last updated     : 17.10.1993                        */
  9. /* Compiler        : SAS/C V6.3                        */
  10. /* Compiler-Options : (smakefile)                                           */
  11. /* ************************************************************************ */
  12. /* Address        : Andreas R. Kleinert                    */
  13. /*              Grube Hohe Grethe 23                    */
  14. /*              D-57074 Siegen                        */
  15. /*              Germany                            */
  16. /* ************************************************************************ */
  17.  
  18. /* NOTE : Always make use of #pragmas, if possible and NEVER use stubs
  19.       for "ak_gen0.library", when using ANY kind of #pragmas under
  20.       SAS/C V6.00+
  21. */
  22.  
  23. #ifndef AK_GEN0_AK_GEN0_H
  24. #define AK_GEN0_AK_GEN0_H
  25.  
  26.  
  27. /* *************************************************** */
  28. /* *                                                 * */
  29. /* * Version and Revision Defines                    * */
  30. /* *                                                 * */
  31. /* *************************************************** */
  32.  
  33. #define AK_GEN0_VERSION  (38)
  34. #define AK_GEN0_REVISION (20)
  35.  
  36. #define AK_GEN0_MINIMUM (35)
  37.  
  38. /* You should only use versions greater than V34, because of various reasons.
  39.    Your actual "minimum" may be higher, if you make use of new functions.
  40. */
  41.  
  42.  
  43. /* *************************************************** */
  44. /* *                                                 * */
  45. /* * #includes                                       * */
  46. /* *                                                 * */
  47. /* *************************************************** */
  48.  
  49. #ifndef INTUITION_INTUITION_H
  50. #include <intuition/intuitionbase.h>
  51. #endif /* INTUITION_INTUITION_H */
  52.  
  53. #ifndef EXEC_MEMORY_H
  54. #include <exec/memory.h>
  55. #endif /* EXEC_MEMORY_H */
  56.  
  57. #ifndef EXEC_LISTS_H
  58. #include <exec/lists.h>
  59. #endif /* EXEC_LISTS_H */
  60.  
  61. #ifndef GRAPHICS_GFXBASE_H
  62. #include <graphics/gfxbase.h>
  63. #endif /* GRAPHICS_GFXBASE_H */
  64.  
  65. #ifndef LIBRARIES_DOS_H
  66. #include <libraries/dos.h>
  67. #endif /* LIBRARIES_DOS_H */
  68.  
  69. #ifndef _STDIO_H
  70. #include <stdio.h>
  71. #endif /* _STDIO_H */
  72.  
  73.  
  74. /* *************************************************** */
  75. /* *                                                 * */
  76. /* * Specific Defines                                * */
  77. /* *                                                 * */
  78. /* *************************************************** */
  79.  
  80. #define N (NULL)
  81.  
  82. #define NEWWINDOW  (sizeof(struct NewWindow))
  83. #define WINDOW       (sizeof(struct Window))
  84. #define BORDER       (sizeof(struct Border))
  85. #define MENU       (sizeof(struct Menu))
  86. #define GADGET       (sizeof(struct Gadget))
  87. #define ITEXT       (sizeof(struct IntuiText))
  88. #define ITEM       (sizeof(struct MenuItem))
  89. #define SUBITEM     ITEM
  90. #define STRINGINFO (sizeof(struct StringInfo))
  91. #define REQUESTER  (sizeof(struct Requester))
  92. #define PROPINFO   (sizeof(struct PropInfo))
  93. #define ALERT       (sizeof(struct AlertData))
  94. #define NEWSCREEN  (sizeof(struct NewScreen))
  95.  
  96.  
  97. /* *************************************************** */
  98. /* *                                                 * */
  99. /* * Specific Constants                              * */
  100. /* *                                                 * */
  101. /* *************************************************** */
  102.  
  103. #define AK_FILEREQ_STRING_LEN (256) /* The Filerequester creates a string   */
  104.                     /* of this length.                */
  105.                     /* This will not change (because of the */
  106.                     /* nice BCPL-like DOS) and can be used  */
  107.                     /* as a parameter to "FreeMem()".       */
  108.  
  109.  
  110. /* *************************************************** */
  111. /* *                                                 * */
  112. /* * Library Base Definitions                        * */
  113. /* *                                                 * */
  114. /* *************************************************** */
  115.  
  116. /* Library-Bases are to be declared as externals.      */
  117. /* Define AKG_NOBASES if you do not want to use these. */
  118.  
  119. #ifndef AKG_NOBASES
  120.  
  121. struct IntuitionBase *IntuitionBase = N;
  122. struct GfxBase         *GfxBase        = N;
  123. struct AKBase         *AKBase        = N;
  124.  
  125. #endif /* AKG_NOBASES */
  126.  
  127.  
  128. /* *************************************************** */
  129. /* *                                                 * */
  130. /* * MACROs                                          * */
  131. /* *                                                 * */
  132. /* *************************************************** */
  133.  
  134. #define xMEN(x) MENUNUM(x->Code)  /* NOTE : Use these, if possible         */
  135. #define xITN(x) ITEMNUM(x->Code)  /*        or use the originals !!!       */
  136. #define xSTN(x) SUBNUM(x->Code)
  137.  
  138.  
  139. /* *************************************************** */
  140. /* *                                                 * */
  141. /* * Structure Definitions                           * */
  142. /* *                                                 * */
  143. /* *************************************************** */
  144.  
  145.  /* Note : Currently there are two different kinds of Requesters
  146.        implemented : The FileRequester and the ModeRequester.
  147.        Do no longer use the (obsolete) AK_Requester structure, but
  148.        the new specific ones.
  149.        The new structures are be backward-compatible to the old ones.
  150.  */
  151.  
  152. struct AK_FileRequester
  153. {
  154.  APTR  akr_APTR;       /* RESERVED. ONLY FOR PRIVATE USE.            */
  155.  
  156.  ULONG akr_Type;       /* Requestertype. See flags below. DO NOT CHANGE !!! */
  157.  
  158.  ULONG akr_Flags;      /* PRIVATE. (up to now)                              */
  159.  ULONG akr_Reserved1;  /* PRIVATE. (up to now)                              */
  160.  
  161.  /* ENTRIES TO BE MODIFIED BY THE USER (BEGIN) */
  162.  
  163.  APTR  akr_Window;     /* Pointer to User-Window or NULL (CURRENT_WINDOW).  */
  164.  
  165.  LONG  akr_LeftEdge;   /* Distance to the left border of your Screen.        */
  166.  LONG  akr_TopEdge;    /* Distance to the top border of your Screen.        */
  167.  
  168.  BYTE *akr_Title;      /* Pointer to title text for Window.  May be NULL.   */
  169.  BYTE *akr_OKText;     /* Pointer to text for OK-Gadget.     May be NULL.   */
  170.  BYTE *akr_CancelText; /* Pointer to text for Cancel-Gadget. May be NULL.   */
  171.  
  172.  LONG  akr_FGColor;    /* Foreground color (window). Default is -1.         */
  173.  LONG  akr_BGColor;    /* Background color (window). Default is -1.         */
  174.                /* With ak_gen0-Requester only used for OK/Cancel    */
  175.                /* gadgets.                        */
  176.  
  177.  ULONG akr_DefaultDir; /* Default-DirectoryName                             */
  178.  ULONG akr_DefaultFile;/* Default-FileName                                  */
  179.  
  180.  /* ENTRIES TO BE MODIFIED BY THE USER (END) */
  181.  
  182.  ULONG akr_ULONG[1];   /* Always set to NULL yet.                           */
  183.  
  184.  APTR  akr_Tags;       /* RESERVED for future expansions. Always NULL.        */
  185.  
  186.  /* ======================================================================= */
  187.  /* SIZE MAY GROW IN FUTURE VERSIONS. ONLY ALLOC WITH AK_AllocRequester() ! */
  188.  /* FREE WITH AK_FreeRequester().                                           */
  189.  /* ======================================================================= */
  190. };
  191.  
  192. struct AK_ScreenModeRequester
  193. {
  194.  APTR  akr_APTR;       /* RESERVED. ONLY FOR PRIVATE USE.            */
  195.  
  196.  ULONG akr_Type;       /* Requestertype. See flags below. DO NOT CHANGE !!! */
  197.  
  198.  ULONG akr_Flags;      /* PRIVATE. (up to now)                              */
  199.  ULONG akr_Reserved1;  /* PRIVATE. (up to now)                              */
  200.  
  201.  /* ENTRIES TO BE MODIFIED BY THE USER (BEGIN) */
  202.  
  203.  APTR  akr_Window;     /* Pointer to User-Window or NULL (CURRENT_WINDOW).  */
  204.  
  205.  LONG  akr_LeftEdge;   /* Distance to the left border of your Screen.        */
  206.  LONG  akr_TopEdge;    /* Distance to the top border of your Screen.        */
  207.  
  208.  BYTE *akr_Title;      /* Pointer to title text for Window.  May be NULL.   */
  209.  BYTE *akr_OKText;     /* Pointer to text for OK-Gadget.     May be NULL.   */
  210.  BYTE *akr_CancelText; /* Pointer to text for Cancel-Gadget. May be NULL.   */
  211.  
  212.  LONG  akr_FGColor;    /* Foreground color (window). Default is -1.         */
  213.  LONG  akr_BGColor;    /* Background color (window). Default is -1.         */
  214.                /* With ak_gen0-Requester only used for OK/Cancel    */
  215.                /* gadgets.                        */
  216.  
  217.  /* ENTRIES TO BE MODIFIED BY THE USER (END) */
  218.  
  219.  ULONG akr_ULONG[3];   /* Always set to NULL yet.                           */
  220.  
  221.  APTR  akr_Tags;       /* RESERVED for future expansions. Always NULL.        */
  222.  
  223.  /* ======================================================================= */
  224.  /* SIZE MAY GROW IN FUTURE VERSIONS. ONLY ALLOC WITH AK_AllocRequester() ! */
  225.  /* FREE WITH AK_FreeRequester().                                           */
  226.  /* ======================================================================= */
  227. };
  228.  
  229. /*
  230.    HOW TO USE THE REQUESTER-STRUCTURES :
  231.  
  232.    Alloc the structures with :
  233.    ---------------------------
  234.                  AK_AllocRequester()
  235.  
  236.    Use the structures with   :
  237.    ---------------------------
  238.                    - AK_ExtFileRequest()  (if AK_REQTYPE_FILE)
  239.                    - AK_ModeRequest()     (if AK_REQTYPE_MODE)
  240.  
  241.    Free the structures with  :
  242.    ---------------------------
  243.                  AK_FreeRequester()
  244. */
  245.  
  246.  
  247. /* Flags for akr_Type AND AK_AllocRequester() */
  248.  
  249. #define AK_REQTYPE_NONE     (0x00000000)
  250. #define AK_REQTYPE_INVALID  (0xFFFFFFFF)
  251.  
  252. #define AK_REQTYPE_FILE      (0x00000002)
  253. #define AK_REQTYPE_MODE      (0x00000004)
  254.  
  255. #define AK_REQTYPE_RESERVED1 (0x00000001) /* unused, fails yet */
  256. #define AK_REQTYPE_RESERVED2 (0x00000003) /* unused, fails yet */
  257.  
  258.  
  259. /* Flags for akr_Flags : */
  260.  
  261. #define AK_REQFLAG_RESERVED (~(NULL)) /* PRIVATE. (up to now) */
  262.  
  263.  
  264.  /* *********************************************************************** */
  265.  
  266.  /* Below you find the definitions for structures which are used by
  267.     the V37-function AK_GetDirList() and delocated by AK_FreeDirList().
  268.     These functions are used by the internal FileRequester, but may also
  269.     be used by applications.
  270.  */
  271.  
  272. struct AK_DirList
  273. {
  274.  struct List dl_EntryList;  /* List of Entries. Type : struct AK_DirEntry */
  275.  LONG         dl_NumEntries; /* Number of List-Entries              */
  276.  
  277.  /* ======================================================================= */
  278.  /* SIZE MAY GROW IN FUTURE VERSIONS. DO NOT ALLOCATE BY HAND !         */
  279.  /* ======================================================================= */
  280. };
  281.  
  282. #define AK_DE_DIR    (1<<0) /* Flags set in the de_Flags field. */
  283. #define AK_DE_FILE   (1<<1)
  284. #define AK_DE_VOLUME (1<<2)
  285. #define AK_DE_ASSIGN (1<<3)
  286.  
  287. struct AK_DirEntry
  288. {
  289.  struct Node  de_Node;         /* Node for chaining              */
  290.  BYTE         *de_Name;         /* Entry's Name (== de_Node.ln_Name)         */
  291.  LONG          de_NameBufLen; /* Length of NameBuffer              */
  292.  ULONG          de_Flags;      /* Flags : File, Dir, ...              */
  293.  
  294.  /* ======================================================================= */
  295.  /* SIZE MAY GROW IN FUTURE VERSIONS. DO NOT ALLOCATE BY HAND !         */
  296.  /* ======================================================================= */
  297. };
  298.  
  299.  
  300.  /* *********************************************************************** */
  301.  
  302.  /* Below you find the definitions for structures which are used by
  303.     the V37-function AK_GetModeList() and delocated by AK_FreeModeList().
  304.     These functions are used by the internal ModeRequester, but may also
  305.     be used by applications.
  306.  */
  307.  
  308. struct AK_ModeList
  309. {
  310.  struct List ml_EntryList;  /* List of Entries. Type : struct AK_ModeEntry */
  311.  LONG         ml_NumEntries; /* Number of List-Entries               */
  312.  
  313.  /* ======================================================================= */
  314.  /* SIZE MAY GROW IN FUTURE VERSIONS. DO NOT ALLOCATE BY HAND !         */
  315.  /* ======================================================================= */
  316. };
  317.  
  318.      /* The AK_ModeEntry structure, retured by AK_GetModeList() */
  319.  
  320. struct AK_ModeEntry
  321. {
  322.  struct Node ModeNode;
  323.  
  324.  ULONG         Length;         /* THIS IS THE LENGTH OF THIS STRUCTURE.         */
  325.  
  326.  BYTE         ModeName [80];  /* V33+ : constructed Name --- V37+ : ModeName  */
  327.  LONG         StandardWidth;  /* standard Screen-Depth                 */
  328.  LONG         StandardHeight; /* standard Screen-Depth                 */
  329.  LONG         MaxWidth;         /* maximum  Screen-Width  (OverScan)            */
  330.  LONG         MaxHeight;      /* maximum  Screen-Height (OverScan)            */
  331.  LONG         MaxDepth;         /* maximum  Screen-Depth                 */
  332.  ULONG         ModeID;         /* V33+ : Convert to UWORD --- V37+ : useable   */
  333.  APTR         ModeHandle;     /* V33+ : always NULL    --- V37+ : useable   */
  334.  
  335.  /* SIZE MAY GROW IN THE FUTURE !!! */
  336. };
  337.  
  338.  
  339.  /* *********************************************************************** */
  340.  
  341.  /* Below you find the definitions for structures which are used by
  342.     the V38-functions for memory allocation, delocation and remembering.
  343.     These functions are used by the internal Requesters, but may also
  344.     be used by applications.
  345.  */
  346.  
  347. struct AK_MemList
  348. {
  349.  struct List ml_EntryList;  /* List of Entries. Type : struct AK_MemEntry */
  350.  LONG         ml_NumEntries; /* Number of List-Entries              */
  351.  
  352.  /* ======================================================================= */
  353.  /* SIZE MAY GROW IN FUTURE VERSIONS. DO NOT ALLOCATE BY HAND !         */
  354.  /* ======================================================================= */
  355. };
  356.  
  357.      /* The AK_MemEntry structure, retured by AK_GetMemList() */
  358.  
  359. struct AK_MemEntry
  360. {
  361.  struct Node MemNode;
  362.  
  363.  ULONG Length;           /* THIS IS THE LENGTH OF THIS STRUCTURE.        */
  364.  
  365.  ULONG MemSize;
  366.  APTR  MemPointer;
  367.  
  368.  /* SIZE MAY GROW IN THE FUTURE !!! */
  369. };
  370.  
  371.  
  372. /* *************************************************** */
  373. /* *                                                 * */
  374. /* * Library Function Declarations                   * */
  375. /* *                                                 * */
  376. /* *************************************************** */
  377.  
  378. #ifndef AKG_NOPROTOS
  379.  
  380. extern struct Screen *       __stdargs AK_Screen(long l, long t, long w, long h, long d,
  381.                            long dp, long bp, long vm, long ty,
  382.                            struct TextAttr *f, char *title,
  383.                            struct BitMap *cbm);
  384. extern struct Window *       __stdargs AK_Window(long l, long t, long w, long h, long d,
  385.                            long b, long idcmp, long flags,
  386.                            struct Gadget *fg, struct Image *cm,
  387.                            char *title, struct Screen *screen,
  388.                            struct BitMap *bm, long minw, long minh,
  389.                            long maxw, long maxh, long type);
  390. extern struct Menu *       __stdargs AK_Menu(struct Menu *next, long l, long w, long flags,
  391.                          char *name, struct MenuItem *item);
  392. extern struct MenuItem *   __stdargs AK_MenuItem(struct MenuItem *next, long t, long w,
  393.                          long flags, long me, APTR itfi,
  394.                          APTR sefi, long scut,
  395.                          struct MenuItem *subi);
  396. extern struct MenuItem *   __stdargs AK_SubItem(struct MenuItem *next, long l, long t,
  397.                         long w, long flags, long me, APTR itfi,
  398.                         APTR sefi, long scut,
  399.                         struct MenuItem *subi);
  400. extern struct Gadget *       __stdargs AK_Gadget(struct Gadget *next, long l, long t, long w,
  401.                            long h, long flags, long act, long type,
  402.                            APTR gadr, APTR selr, struct IntuiText *text,
  403.                            APTR sp, long id);
  404. extern struct StringInfo * __stdargs AK_StringInfo(long groesse, long maximum,
  405.                            struct KeyMap *km);
  406. extern struct Border * __stdargs AK_Border(long l, long t, long f, long b, long d,
  407.                        long c, SHORT *xy, struct Border *next);
  408. extern struct IntuiText * __stdargs AK_IText(long f, long b, long d, long l, long t,
  409.                          struct TextAttr *font, char *text,
  410.                          struct IntuiText *next);
  411. extern void          __stdargs AK_GfxPrint(struct Window *w, char *text, long x, long y);
  412. extern void          __stdargs AK_IntuiPrint(struct Window *w, char *text, long x, long y);
  413. extern void          __stdargs AK_RefreshDisp(struct Screen *sc, struct Window *w);
  414. extern long          __stdargs AK_AutoRequester(struct Window *w, char *obertext, char *jatext,
  415.                      char *neintext);
  416. extern long          __stdargs AK_Alert(char *text, long height);
  417. extern char *          __stdargs AK_FileRequest(long xpos, long ypos, struct Screen *fscreen,
  418.                        struct Window *fwindow, long ftype);
  419. extern long /* OBSOLETE */__stdargs AK_ReadDir(char *pathname, char **direntry, long *dirtype);
  420. extern void  __stdargs AK_WaitKey(long rawcode);
  421. extern void  __stdargs AK_WaitLeft(void);
  422. extern long  __stdargs AK_GetNum(long min, long max);
  423.  
  424.  /* NEW in V36 */
  425.  
  426. extern APTR   __stdargs AK_AllocRequester(long type);
  427. extern void   __stdargs AK_FreeRequester(struct AK_Requester *ak_req);
  428. extern char * __stdargs AK_ExtFileRequest(struct AK_Requester *ak_req);
  429.  
  430.  /* NEW in V37 */
  431.  
  432. extern struct AK_DirList *   __stdargs AK_GetDirList(char *dirname, APTR reserved);
  433. extern void             __stdargs AK_FreeDirList(struct AK_DirList *ak_list);
  434. extern struct AK_ModeList *  __stdargs AK_GetModeList(void);
  435. extern void             __stdargs AK_FreeModeList(struct AK_ModeList *modelist);
  436. extern struct AK_ModeEntry * __stdargs AK_ModeRequest(struct AK_Requester *ak_req);
  437.  
  438.  /* NEW in V38 */
  439.  
  440. extern struct AK_MemList * __stdargs AK_GetMemList(void);
  441. extern void           __stdargs AK_FreeMemList(struct AK_MemList *MemList);
  442. extern long           __stdargs AK_AddMemEntry(struct AK_MemList *mlist, APTR pointer, long size);
  443. extern APTR           __stdargs AK_AllocMemEntry(struct AK_MemList *mlist, ULONG size, ULONG type);
  444.  
  445. #endif /* AKG_NOPROTOS */
  446.  
  447.  
  448. /* *************************************************** */
  449. /* *                                                 * */
  450. /* * OBSOLETE #includes                              * */
  451. /* *                                                 * */
  452. /* *************************************************** */
  453.  
  454.  /* Now include the OBSOLETE things of former versions.
  455.     Define AKG_NOOBSOLETE if you don't make use of them.
  456.     (Actually you SHOULD NOT make use of them.)
  457.  */
  458.  
  459. #ifndef AKG_NOOBSOLETE
  460. #include <ak_gen0_obsolete.h>
  461. #endif /* AKG_NOOBSOLETE */
  462.  
  463.  
  464. #endif /* AK_GEN0_AK_GEN0_H */
  465.